package com.ny.controller;

import com.ny.entity.Classrooms;
import com.ny.service.ClassroomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Controller
public class ClassRoomController {
    @Autowired
    private  ClassroomService classroomService;
    @RequestMapping("/classroomList")
    public String classroomList(Model model){
        model.addAttribute("classroomList", classroomService.findAllClassrooms());
        return "classroom";
    }

}
